<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>循环精灵图</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        
        li {
            list-style-type: none;
        }
        
        #box {
            width: 250px;
            margin: 100px auto;
        }
        
        #box li {
            float: left;
            width: 25px;
            height: 25px;
            background-color: pink;
            margin: 15px;
            background: url(image/6-3-1.png) no-repeat;
            background-position: 44 88;
        }
    </style>
</head>

<body>
    <div id="box">
        <ul>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
    <script>
        var lis = document.querySelectorAll('li')
        for (var i = 0; i < lis.length; i++) {
            var index = i * 44
            lis[i].style.backgroundPosition = '0 -' + index + 'px'
        }
    </script>
</body>

</html>